#import "../fragments/vulnerability_detail.fragment.graphql"

query getSecurityReportFinding($projectFullPath: ID!, $pipelineIid: ID!, $findingUuid: String!) {
  project(fullPath: $projectFullPath) {
    id
    webUrl
    nameWithNamespace
    pipeline(iid: $pipelineIid) {
      id
      securityReportFinding(uuid: $findingUuid) {
        uuid
        title
        description
        descriptionHtml
        state
        severity
        solution
        reportType
        falsePositive
        remediations {
          diff
          summary
        }
        scanner {
          id
          name
        }
        assets {
          name
          url
        }
        project {
          id
          name
          webUrl
          nameWithNamespace
        }
        evidence {
          summary
          request {
            body
            headers {
              name
              value
            }
            method
            url
          }
          response {
            body
            reasonPhrase
            statusCode
            headers {
              name
              value
            }
          }
          supportingMessages {
            name
            response {
              body
              reasonPhrase
              statusCode
              headers {
                name
                value
              }
            }
          }
          source {
            name
          }
        }
        location {
          ... on VulnerabilityLocationSast {
            startLine
            endLine
            file
            blobPath
          }
          ... on VulnerabilityLocationDependencyScanning {
            blobPath
            file
          }
          ... on VulnerabilityLocationSecretDetection {
            startLine
            endLine
            file
            blobPath
          }
          ... on VulnerabilityLocationCoverageFuzzing {
            startLine
            endLine
            file
            blobPath
          }
        }
        links {
          name
          url
        }
        identifiers {
          name
          url
        }
        issueLinks {
          nodes {
            id
            linkType
            issue {
              id
              iid
              createdAt
              webUrl
              author {
                id
                webUrl
                name
                username
              }
            }
          }
        }
        details {
          ...NonNestedReportTypes
          ...List
          ...Table
        }
        dismissedAt
        dismissedBy {
          id
          name
          username
          webUrl
        }
        stateComment
        vulnerability {
          id
          userPermissions {
            createVulnerabilityFeedback
          }
          mergeRequest {
            id
            iid
            createdAt
            webUrl
            author {
              id
              webUrl
              name
              username
            }
          }
        }
      }
    }
  }
}
